 package server.life;

 import client.MapleCharacter;
import client.MapleDisease;
import client.status.MonsterStatus;
import client.status.MonsterStatusEffect;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import constants.GameConstants;
import constants.ServerConstants;
import server.FairyDust;
import server.maps.*;
import tools.MaplePacketCreator;
import tools.Randomizer;
import tools.packet.LucidPacket;
import tools.packet.MobPacket;
import tools.packet.UIPacket;

import java.awt.*;
import java.util.*;
import java.util.List;





























 public class MobSkill {
   private final int skillId;
   private final int skillLevel;
   private int mpCon;
   private int spawnEffect;
   private int hp;
/*   38 */   private List<Integer> toSummon = new ArrayList<>(); private int x; private int y; private long duration; private long cooltime; private float prop; private short limit; private Point lt; private Point rb;
   private boolean summonOnce;
   private int areaSequenceDelay;
   private int skillAfter;
   private int force;
   private int forcex;

   @JsonCreator
   public MobSkill(@JsonProperty("skillId") int skillId, @JsonProperty("level") int level) {
/*   47 */     this.skillId = skillId;
/*   48 */     this.skillLevel = level;
   }

   public void setOnce(boolean o) {
/*   52 */     this.summonOnce = o;
   }

   public boolean onlyOnce() {
/*   56 */     return this.summonOnce;
   }

   public void addSummons(List<Integer> toSummon) {
/*   60 */     this.toSummon = toSummon;
   }

   public void setHp(int hp) {
/*   64 */     this.hp = hp;
   }

   public void setProp(float prop) {
/*   68 */     this.prop = prop;
   }

   public void setLtRb(Point lt, Point rb) {
/*   72 */     this.lt = lt;
/*   73 */     this.rb = rb;
   }

   public boolean checkCurrentBuff(MapleCharacter player, MapleMonster monster) {
/*   77 */     boolean stop = false;
/*   78 */     switch (this.skillId) {
       case 100:
       case 110:
       case 150:
/*   82 */         stop = monster.isBuffed(MonsterStatus.MOB_STAT_PowerUp);
         break;
       case 101:
       case 111:
       case 151:
/*   87 */         stop = monster.isBuffed(MonsterStatus.MOB_STAT_MagicUp);
         break;
       case 102:
       case 112:
       case 152:
/*   92 */         stop = monster.isBuffed(MonsterStatus.MOB_STAT_PGuardUp);
         break;
       case 103:
       case 113:
       case 153:
/*   97 */         stop = monster.isBuffed(MonsterStatus.MOB_STAT_MGuardUp);
         break;







       case 140:
       case 141:
       case 142:
       case 143:
       case 144:
       case 145:
/*  112 */         stop = (monster.isBuffed(MonsterStatus.MOB_STAT_HardSkin) || monster.isBuffed(MonsterStatus.MOB_STAT_MImmune) || monster.isBuffed(MonsterStatus.MOB_STAT_PCounter) || monster.isBuffed(MonsterStatus.MOB_STAT_PImmune) || monster.isBuffed(MonsterStatus.MOB_STAT_MCounter) || monster.isBuffed(MonsterStatus.MOB_STAT_Dazzle) || monster.isBuffed(MonsterStatus.MOB_STAT_SealSkill));
         break;
       case 200:
/*  115 */         stop = (player.getMap().getNumMonsters() >= this.limit);
         break;
     }
/*  118 */     stop |= monster.isBuffed(MonsterStatus.MOB_STAT_MagicCrash);
/*  119 */     return stop;
   }









































   public void applyEffect(MapleCharacter player, MapleMonster monster, int effectAfter, boolean skill) {
     BanishInfo info;
     boolean Change;
     int n13;
     ArrayList<Rectangle> list2, rectangles;
     int intValue;
     boolean nowChange;
     int i, abs, n7, j, spawnCount;
/*  170 */     MapleDisease disease = MapleDisease.getBySkill(this.skillId);
/*  171 */     Map<MonsterStatus, Integer> stats = new EnumMap<>(MonsterStatus.class);
/*  172 */     List<Integer> reflection = new LinkedList<>();

/*  174 */     switch (this.skillId) {
       case 100:
       case 110:
       case 150:
/*  178 */         stats.put(MonsterStatus.MOB_STAT_PowerUp, Integer.valueOf(this.x));
         break;
       case 101:
       case 111:
       case 151:
/*  183 */         stats.put(MonsterStatus.MOB_STAT_MagicUp, Integer.valueOf(this.x));
         break;
       case 102:
       case 112:
       case 152:
/*  188 */         stats.put(MonsterStatus.MOB_STAT_PGuardUp, Integer.valueOf(this.x));
         break;
       case 103:
       case 113:
       case 153:
/*  193 */         stats.put(MonsterStatus.MOB_STAT_MGuardUp, Integer.valueOf(this.x));
         break;
       case 154:
/*  196 */         stats.put(MonsterStatus.MOB_STAT_ACC, Integer.valueOf(this.x));
         break;
       case 155:
/*  199 */         stats.put(MonsterStatus.MOB_STAT_EVA, Integer.valueOf(this.x));
         break;
       case 115:
       case 156:
/*  203 */         stats.put(MonsterStatus.MOB_STAT_Speed, Integer.valueOf(this.x));
         break;
       case 157:
/*  206 */         stats.put(MonsterStatus.MOB_STAT_Seal, Integer.valueOf(this.x));
         break;
       case 236:
/*  209 */         stats.put(MonsterStatus.MOB_STAT_HangOver, Integer.valueOf(this.x));
         break;

       case 188:
/*  213 */         stats.put(MonsterStatus.MOB_STAT_Dazzle, Integer.valueOf(this.x));
         break;

       case 209:
         break;

       case 114:
/*  220 */         if (this.lt != null && this.rb != null && skill && monster != null) {
/*  221 */           List<MapleMapObject> objects = getObjectsInRange(monster, MapleMapObjectType.MONSTER);
/*  222 */           int hps = getX() / 1000 * (int)(950.0D + 1050.0D * Math.random());
/*  223 */           for (MapleMapObject mons : objects)
/*  224 */             ((MapleMonster)mons).heal(hps, getY(), true);  break;
         }
/*  226 */         if (monster != null) {
/*  227 */           monster.heal(getX(), getY(), true);
         }
         break;
       case 105:
/*  231 */         if (this.lt != null && this.rb != null && skill && monster != null) {
/*  232 */           List<MapleMapObject> objects = getObjectsInRange(monster, MapleMapObjectType.MONSTER);
/*  233 */           for (MapleMapObject mons : objects) {
/*  234 */             if (mons.getObjectId() != monster.getObjectId()) {
/*  235 */               player.getMap().killMonster((MapleMonster)mons, player, true, false, (byte)1, 0);
/*  236 */               monster.heal(getX(), getY(), true); break;
             }
           }  break;
         }
/*  240 */         if (monster != null) {
/*  241 */           monster.heal(getX(), getY(), true);
         }
         break;
       case 127:
/*  245 */         if (this.lt != null && this.rb != null && skill && monster != null && player != null) {
/*  246 */           for (MapleCharacter character : getPlayersInRange(monster, player))
/*  247 */             character.dispel();  break;
         }
/*  249 */         if (player != null) {
/*  250 */           player.dispel();
         }
         break;
       case 129:
/*  254 */         if (monster == null || monster.getMap().getSquadByMap() != null || (
/*  255 */           monster.getEventInstance() != null && monster.getEventInstance().getName().contains("BossQuest")) || monster.getStats().getBanishInfo().isEmpty()) {
           break;
         }
/*  258 */         info = monster.getStats().getBanishInfo().get(Randomizer.nextInt(monster.getStats().getBanishInfo().size()));
/*  259 */         if (info != null) {
/*  260 */           if (this.lt != null && this.rb != null && skill && player != null) {
/*  261 */             for (MapleCharacter chr : getPlayersInRange(monster, player)) {
/*  262 */               if (!chr.hasBlockedInventory())
/*  263 */                 chr.changeMapBanish(info.getMap(), info.getPortal(), info.getMsg()); 
             }  break;
           }
/*  266 */           if (player != null && !player.hasBlockedInventory()) {
/*  267 */             player.changeMapBanish(info.getMap(), info.getPortal(), info.getMsg());
           }
         }
         break;

       case 131:
       case 180:
       case 186:
       case 191:
/*  276 */         if (monster != null) {
/*  277 */           if (this.skillId == 191) {
/*  278 */             player.getMap().broadcastMessage(UIPacket.getTopMsg("时间裂缝中发生了\"龟裂\"。"));
           }
/*  280 */           MapleMist mist = new MapleMist(calculateBoundingBox(monster.getTruePosition(), monster.isFacingLeft()), monster, this, monster.getPosition());
/*  281 */           mist.setSkillDelay((this.skillId == 186) ? 8 : 0);
/*  282 */           mist.setMistType((this.skillId == 186) ? 1 : 0);
/*  283 */           monster.getMap().spawnMist(mist, (int)getDuration(), false);
         }
         break;
       case 140:
/*  287 */         stats.put(MonsterStatus.MOB_STAT_PImmune, Integer.valueOf(this.x));
         break;
       case 141:
/*  290 */         stats.put(MonsterStatus.MOB_STAT_MImmune, Integer.valueOf(this.x));
         break;
       case 142:
/*  293 */         stats.put(MonsterStatus.MOB_STAT_HardSkin, Integer.valueOf(this.x));
         break;
       case 143:
/*  296 */         stats.put(MonsterStatus.MOB_STAT_PCounter, Integer.valueOf(this.x));
/*  297 */         stats.put(MonsterStatus.MOB_STAT_PImmune, Integer.valueOf(this.x));
/*  298 */         stats.put(MonsterStatus.MOB_STAT_MGuardUp, Integer.valueOf(this.x));
/*  299 */         reflection.add(Integer.valueOf(this.x));
/*  300 */         if (monster != null) {
/*  301 */           monster.getMap().startMapEffect("请停止攻击，" + monster.getStats().getName() + "开启了反射物攻状态！", 5120116, (int)getDuration() / 1000);
/*  302 */           monster.getMap().broadcastMessage(MaplePacketCreator.spouseMessage(10, "[系统提示] 注意 " + monster.getStats().getName() + " 即将开启反射物攻状态。" + getDuration()));
         }
         break;
       case 144:
/*  306 */         stats.put(MonsterStatus.MOB_STAT_MCounter, Integer.valueOf(this.x));
/*  307 */         stats.put(MonsterStatus.MOB_STAT_MImmune, Integer.valueOf(this.x));
/*  308 */         reflection.add(Integer.valueOf(this.x));
/*  309 */         if (monster != null) {
/*  310 */           monster.getMap().startMapEffect("请停止攻击，" + monster.getStats().getName() + "开启了反射魔攻状态！", 5120116, (int)getDuration() / 1000);
/*  311 */           monster.getMap().broadcastMessage(MaplePacketCreator.spouseMessage(10, "[系统提示] 注意 " + monster.getStats().getName() + " 即将开启反射魔攻状态。" + getDuration()));
         }
         break;
       case 145:
/*  315 */         stats.put(MonsterStatus.MOB_STAT_PCounter, Integer.valueOf(this.x));
/*  316 */         stats.put(MonsterStatus.MOB_STAT_PImmune, Integer.valueOf(this.x));
/*  317 */         stats.put(MonsterStatus.MOB_STAT_MCounter, Integer.valueOf(this.x));
/*  318 */         stats.put(MonsterStatus.MOB_STAT_MImmune, Integer.valueOf(this.x));
/*  319 */         reflection.add(Integer.valueOf(this.x));
/*  320 */         reflection.add(Integer.valueOf(this.x));
/*  321 */         if (monster != null) {
/*  322 */           monster.getMap().startMapEffect("请停止攻击，" + monster.getStats().getName() + "开启了反射物攻和魔攻状态！", 5120116, (int)getDuration() / 1000);
/*  323 */           monster.getMap().broadcastMessage(MaplePacketCreator.spouseMessage(10, "[系统提示] 注意 " + monster.getStats().getName() + " 即将开启反射物攻和魔攻状态。" + getDuration()));
         }
         break;
       case 184:
/*  327 */         this.x = ((player.getPosition()).x << 16) + (player.getPosition()).y;
         break;

       case 200:
/*  331 */         if (monster == null) {
           return;
         }
/*  334 */         for (Integer mobId : getSummons()) {
           MapleMonster toSpawn;
           try {
/*  337 */             toSpawn = MapleLifeFactory.getMonster(GameConstants.getCustomSpawnID(monster.getId(), mobId.intValue()));
/*  338 */           } catch (RuntimeException e) {
             continue;
           }
/*  341 */           if (toSpawn == null) {
             continue;
           }
/*  344 */           toSpawn.setPosition(monster.getTruePosition());
/*  345 */           int ypos = (int)monster.getTruePosition().getY(), xpos = (int)monster.getTruePosition().getX();
/*  346 */           switch (mobId.intValue()) {
             case 8500003:
/*  348 */               toSpawn.setFh((int)Math.ceil(Math.random() * 19.0D));
/*  349 */               ypos = -590;
               break;

             case 8500004:
/*  353 */               xpos = (int)(monster.getTruePosition().getX() + Math.ceil(Math.random() * 1000.0D) - 500.0D);
/*  354 */               ypos = (int)monster.getTruePosition().getY();
               break;
             case 8510100:
/*  357 */               if (Math.ceil(Math.random() * 5.0D) == 1.0D) {
/*  358 */                 ypos = 78;
/*  359 */                 xpos = (int)(0.0D + Math.ceil(Math.random() * 5.0D)) + ((Math.ceil(Math.random() * 2.0D) == 1.0D) ? 180 : 0); break;
               }
/*  361 */               xpos = (int)(monster.getTruePosition().getX() + Math.ceil(Math.random() * 1000.0D) - 500.0D);
               break;


             case 8820007:
             case 8820107:
               continue;
           }

/*  370 */           switch (monster.getMap().getId()) {
             case 220080001:
/*  372 */               if (xpos < -890) {
/*  373 */                 xpos = (int)(-890.0D + Math.ceil(Math.random() * 150.0D)); break;
/*  374 */               }  if (xpos > 230) {
/*  375 */                 xpos = (int)(230.0D - Math.ceil(Math.random() * 150.0D));
               }
               break;
             case 230040420:
/*  379 */               if (xpos < -239) {
/*  380 */                 xpos = (int)(-239.0D + Math.ceil(Math.random() * 150.0D)); break;
/*  381 */               }  if (xpos > 371) {
/*  382 */                 xpos = (int)(371.0D - Math.ceil(Math.random() * 150.0D));
               }
               break;
           }
/*  386 */           monster.getMap().spawnMonsterWithEffect(toSpawn, getSpawnEffect(), monster.getMap().calcPointBelow(new Point(xpos, ypos - 1)));
         }
         break;
       case 201:
/*  390 */         if (monster == null) {
           return;
         }
/*  393 */         if (toSpawnSkill(this.skillLevel)) {
/*  394 */           for (Integer mobId : getSummons()) {
             MapleMonster toSpawn;
             try {
/*  397 */               toSpawn = MapleLifeFactory.getMonster(GameConstants.getCustomSpawnID(monster.getId(), mobId.intValue()));
/*  398 */             } catch (RuntimeException e) {
               continue;
             }
/*  401 */             if (toSpawn == null) {
               continue;
             }


/*  406 */             for (MapleMapObject ob : player.getMap().getAllMonster()) {
/*  407 */               int mobid = ((MapleMonster)ob).getId();
/*  408 */               if (mobid == toSpawn.getId()) {
                 return;
               }
             }


/*  414 */             toSpawn.setPosition(monster.getTruePosition());
/*  415 */             int ypos = (int)monster.getTruePosition().getY(), xpos = (int)monster.getTruePosition().getX();
/*  416 */             switch (mobId.intValue()) {
               case 8880160:
/*  418 */                 xpos = Randomizer.rand(0, 1800);
/*  419 */                 ypos = 48;
                 break;
               case 8880164:
               case 8880165:
               case 8880168:
               case 8880169:
/*  425 */                 xpos = 1000;
/*  426 */                 ypos = 48;
                 break;
             }
/*  429 */             MapleMap map = monster.getMap();
/*  430 */             if (map.getId() == 450004150) {
/*  431 */               int nowMapMobNum = map.getNumMonsters(8880160);
/*  432 */               if (nowMapMobNum >= 10) {
                 continue;
               }
             }

/*  437 */             map.spawnMonsterOnGroundBelow(toSpawn, new Point(xpos, ypos));
           }
           break;
         }
/*  441 */         Change = false;

/*  443 */         nowChange = false;
/*  444 */         n7 = 0;
/*  445 */         spawnCount = 0;
/*  446 */         for (Integer toSummon : getSummons()) {
           boolean bool; MapleMonster monster2;
           try {
/*  449 */             monster2 = MapleLifeFactory.getMonster(GameConstants.getCustomSpawnID(monster.getId(), toSummon.intValue()));
/*  450 */           } catch (RuntimeException ex2) {
             continue;
           }


/*  455 */           for (MapleMapObject ob : player.getMap().getAllMonster()) {
/*  456 */             int mobid = ((MapleMonster)ob).getId();
/*  457 */             if (mobid == monster2.getId()) {
               return;
             }
           }


/*  463 */           boolean b4 = true;
/*  464 */           int ypos = (int)monster.getTruePosition().getY();
/*  465 */           int xpos = (int)monster.getTruePosition().getX();
/*  466 */           int n11 = 0;
/*  467 */           int n12 = 35;
/*  468 */           switch (toSummon.intValue()) {
             case 8900000:
             case 8900001:
             case 8900002:{
                        n11 = 1;
                        n12 = 100;
                        Change = true;
                        if (b4 & n7 == 0) {
                            monster2.handleDeadBound(2);
                            n7 = 1;
                            break;
                        }
                        break;
                    }
             case 8920000:
             case 8920001:
             case 8920002:
             case 8920003:
             case 8920100:
             case 8920101:
             case 8920102:
             case 8920103:
/*  490 */               n11 = 1;
/*  491 */               Change = true;
/*  492 */               b4 = (System.currentTimeMillis() - monster.getChangeTime() > 30000L);
               break;

             case 8900100:
             case 8900101:
             case 8900102:{
                        Change = true;
                        n11 = 1;
                        if (n7 == 0) {
                            monster2.handleDeadBound(2);
                            n7 = 1;
                            break;
                        }
                        break;
                    }

             case 8950007:
             case 8950107:
/*  509 */               xpos = -404;
/*  510 */               ypos = -400;
/*  511 */               monster2.setStance(2);
/*  512 */               nowChange = true;
               break;

             case 8950003:
             case 8950103:
/*  517 */               xpos = 423;
/*  518 */               ypos = -400;
               break;

             case 8950004:
             case 8950104:
/*  523 */               xpos = 505;
/*  524 */               ypos = -230;

/*  526 */               nowChange = true;
               break;

             case 8950005:
             case 8950105:
/*  531 */               xpos = -514;
/*  532 */               ypos = -230;
/*  533 */               monster2.setStance(2);
/*  534 */               nowChange = true;
               break;

             case 8920004:
             case 8920005:
             case 8920104:
             case 8920105:
/*  541 */               if (xpos < -239) {
/*  542 */                 xpos = (int)(-239.0D + Math.ceil(Math.random() * 150.0D));
/*  543 */               } else if (xpos > 371) {
/*  544 */                 xpos = (int)(371.0D - Math.ceil(Math.random() * 150.0D));
               }
/*  546 */               nowChange = true;
               break;

             case 8880306:
/*  550 */               xpos = (spawnCount == 0) ? -625 : 625;
/*  551 */               ypos = 200;
/*  552 */               nowChange = true;
/*  553 */               spawnCount++;
               break;
           }

/*  557 */           if (monster2 != null) {
/*  558 */             monster2.setPosition(monster.getTruePosition());
/*  559 */             if (toSummon.intValue() != monster.getId() && !nowChange && Randomizer.nextInt(100) < n12 && n11 > 0 && b4) {
/*  560 */               monster2.setChangeTime(System.currentTimeMillis());
/*  561 */               if (monster.getChangedStats() != null) {
/*  562 */                 monster2.setOverrideStats(monster.getChangedStats());
               }
/*  564 */               monster2.setStance(monster.getStance());
/*  565 */               monster2.setFh(monster.getFh());
/*  566 */               monster2.setHp(monster.getHp());

/*  568 */               if (Change) {
/*  569 */                 player.getEventInstance().registerMonster(monster2);
               }
/*  571 */               nowChange = true;
             }
/*  573 */             if (!nowChange) {
               continue;
             }
/*  576 */             player.getMap().spawnMonsterWithEffect(monster2, getSpawnEffect(), new Point(xpos, ypos - 1));
           }
         }
/*  579 */         if (nowChange && Change) {
/*  580 */           player.getMap().removeMonster(monster);
/*  581 */           player.getEventInstance().unregisterMonster(monster);
         }
         break;



       case 223:
/*  588 */         skill = false;
/*  589 */         n13 = 1;
/*  590 */         if (monster.getStati().get(MonsterStatus.MOB_STAT_Laser) != null && ((MonsterStatusEffect)monster.getStati().get(MonsterStatus.MOB_STAT_Laser)).getX().intValue() != 0) {
           return;
         }
/*  593 */         stats.put(MonsterStatus.MOB_STAT_Laser, Integer.valueOf(1));
         break;

       case 211:
       case 217:
       case 227:
/*  599 */         player.send(MobPacket.showMobSkillDelay(monster.getObjectId(), this, effectAfter, new ArrayList()));
         break;

       case 226:
/*  603 */         monster.isFacingLeft();
/*  604 */         list2 = new ArrayList<>();
/*  605 */         for (i = 0; i < 3; i++) {
/*  606 */           int av = Randomizer.rand(170, 250);
/*  607 */           list2.add(calculateBoundingBox(new Point((monster.getTruePosition()).x + (monster.isFacingLeft() ? -av : av) * (2 * i - 1), (monster.getTruePosition()).y), monster.isFacingLeft()));
         }
/*  609 */         player.getMap().broadcastMessage(MobPacket.showMobSkillDelay(monster.getObjectId(), this, effectAfter, list2));
         break;

       case 230:
/*  613 */         rectangles = new ArrayList<>();
/*  614 */         abs = Math.abs(130);
/*  615 */         for (j = 0; j < 10; j++) {
/*  616 */           int av2 = Randomizer.rand(abs - 10, abs - 10);
/*  617 */           rectangles.add(calculateBoundingBox(new Point((j % 2 == 0) ? (-654 + av2 * j / 2) : (651 - av2 * j / 2), (monster.getPosition()).y), monster.isFacingLeft()));
         }
/*  619 */         Collections.shuffle(rectangles);
/*  620 */         monster.setRectangles(rectangles);
/*  621 */         player.getMap().broadcastMessage(MobPacket.showMobSkillDelay(monster.getObjectId(), this, this.skillAfter, rectangles));
         break;

       case 228:
/*  625 */         if (monster.getStati() == null || monster.getStati().get(MonsterStatus.MOB_STAT_Laser) == null) {
           break;
         }
/*  628 */         intValue = ((MonsterStatusEffect)monster.getStati().get(MonsterStatus.MOB_STAT_Laser)).getX().intValue();
/*  629 */         if (intValue != 0) {
/*  630 */           long currentTimeMillis = System.currentTimeMillis();
/*  631 */           double second = (currentTimeMillis - ((MonsterStatusEffect)monster.getStati().get(MonsterStatus.MOB_STAT_Laser)).getStartTime()) / 1000.0D;
/*  632 */           boolean firstUse = ((MonsterStatusEffect)monster.getStati().get(MonsterStatus.MOB_STAT_Laser)).isFirstUse();
/*  633 */           int n15 = (int)(second * 9.725508365508366D % 360.0D);
/*  634 */           int en = ((MonsterStatusEffect)monster.getStati().get(MonsterStatus.MOB_STAT_Laser)).getAngle();
/*  635 */           ((MonsterStatusEffect)monster.getStati().get(MonsterStatus.MOB_STAT_Laser)).setStartTime(currentTimeMillis);
/*  636 */           ((MonsterStatusEffect)monster.getStati().get(MonsterStatus.MOB_STAT_Laser)).setAngle(en + (firstUse ? -n15 : n15));
/*  637 */           ((MonsterStatusEffect)monster.getStati().get(MonsterStatus.MOB_STAT_Laser)).setFirstUse(!firstUse);
/*  638 */           player.send_other(MobPacket.controlLaser(monster.getObjectId(), ((MonsterStatusEffect)monster.getStati().get(MonsterStatus.MOB_STAT_Laser)).getAngle(), intValue, ((MonsterStatusEffect)monster.getStati().get(MonsterStatus.MOB_STAT_Laser)).isFirstUse()), true);
         }
         break;


       case 170:
/*  644 */         if (this.skillLevel == 42) {
/*  645 */           Map<Integer, Point> hashMap = new HashMap<>();
/*  646 */           for (int k = 0; k < 3; k++) {
/*  647 */             hashMap.put(Integer.valueOf(k), new Point((monster.getPosition()).x + k * (monster.isFacingLeft() ? -250 : 250), (monster.getPosition()).y));
           }
/*  649 */           player.getMap().broadcastMessage(MobPacket.MonsterDemianDelayedAttackCreate(monster.getObjectId(), 1, hashMap, monster.isFacingLeft()));
           break;
         }
/*  652 */         if (this.skillLevel > 44 && this.skillLevel <= 47) {
/*  653 */           Point point = new Point((monster.getPosition()).x + (monster.isFacingLeft() ? -600 : 600), (monster.getPosition()).y);
/*  654 */           player.getMap().broadcastMessage(MobPacket.teleportMonster(monster.getObjectId(), false, 10, point, 0));
/*  655 */           player.getMap().broadcastMessage(MobPacket.MonsterDemianDelayedAttackCreate(monster.getObjectId(), this.skillLevel, 1, 1, point, monster.isFacingLeft()));
           break;
         }
/*  658 */         if (this.skillLevel == 44) {
/*  659 */           player.getMap().broadcastMessage(MobPacket.teleportMonster(monster.getObjectId(), false, 4, null, ((MapleFoothold)player.getMap().getFootholds().getAllRelevants().get(Randomizer.nextInt(player.getMap().getFootholds().getAllRelevants().size()))).getId()));
         }
         break;










































       case 176:
       case 214:
/*  706 */         player.getMap().broadcastMessage(MobPacket.showMobSkillDelay(monster.getObjectId(), this, effectAfter + 100, new ArrayList()));
/*  707 */         if (monster.getId() / 100 == 88000 || monster.getId() / 100 == 88001) {
/*  708 */           player.getMap().broadcastMessage(MobPacket.showMonsterSpecialSkill(monster.getObjectId(), (this.skillLevel == 24) ? 2 : 0));
         }
/*  710 */         if (monster.getId() == 8881000) {
/*  711 */           player.getMap().broadcastMessage(MobPacket.cancelMonsterAction(monster, 7));
         }
         break;


       case 238:
/*  717 */         player.getMap().broadcastMessage(MobPacket.showMobSkillDelay(monster.getObjectId(), this, effectAfter, new ArrayList()));
/*  718 */         if (this.skillLevel == 4 || this.skillLevel == 10) {
/*  719 */           ArrayList<FairyDust> FairyDust = new ArrayList<>();
/*  720 */           for (int k = 0; k < 6; k++) {
/*  721 */             int scale = Randomizer.rand(0, 1);
/*  722 */             int createDelay = Randomizer.rand(0, 1);
/*  723 */             int moveSpeed = 112;
/*  724 */             int angle = Randomizer.rand(12, 359);
/*  725 */             FairyDust.add(new FairyDust(scale, createDelay, moveSpeed, angle));
           }
/*  727 */           player.getMap().broadcastMessage(LucidPacket.doFairyDustSkill(this.skillLevel, FairyDust));
         }
/*  729 */         if (this.skillLevel == 3 || this.skillLevel == 2 || this.skillLevel == 1) {
/*  730 */           player.getMap().broadcastMessage(LucidPacket.doFlowerTrapSkill(this.skillLevel, Randomizer.rand(0, 2), (player.getPosition()).x, (player.getPosition()).y, false));
         }
/*  732 */         if (this.skillLevel == 5) {
/*  733 */           List<Integer> intervals = new ArrayList<>();
/*  734 */           for (int k = 0; k < 15; k++) {
/*  735 */             intervals.add(Integer.valueOf(500));
           }
/*  737 */           player.getMap().broadcastMessage(LucidPacket.LaserRainSkill(500, intervals));
         }
/*  739 */         if (this.skillLevel == 7) {
/*  740 */           if (player.getMap().getId() == 450004150) {
/*  741 */             player.getMap().broadcastMessage(LucidPacket.createDragon(1, 2308, 30, 2308, -688, false));
           }

/*  744 */           if (player.getMap().getId() == 450004250) {
/*  745 */             player.getMap().broadcastMessage(LucidPacket.createDragon(2, 0, -650, -50, 395, true));
           }
         }

/*  749 */         if (this.skillLevel == 8);


/*  752 */         if (this.skillLevel == 9) {


/*  755 */           player.getMap().broadcastMessage(LucidPacket.setFlyingMode(true));

/*  757 */           player.getMap().ShowSteps(false);

/*  759 */           player.getMap().broadcastMessage(LucidPacket.changeStatueState(true, 0, false));

/*  761 */           player.getMap().broadcastMessage(LucidPacket.UseScreenShoot(2, -1, -1));
/*  762 */           player.getMap().broadcastMessage(LucidPacket.UseScreenShoot(4, 1, 1));
/*  763 */           player.getMap().broadcastMessage(LucidPacket.UseScreenShoot(5, 1, 1));
         }
         break;









       default:
/*  776 */         if (disease == null && ServerConstants.isShowPacket()) {
/*  777 */           player.dropMessage(5, "未处理的怪物技能:" + monster.getId() + " skillid : " + this.skillId);
         }
         break;
     }
/*  781 */     if (stats.size() > 0 && monster != null) {
/*  782 */       if (this.lt != null && this.rb != null && skill) {
/*  783 */         for (MapleMapObject mons : getObjectsInRange(monster, MapleMapObjectType.MONSTER)) {
/*  784 */           ((MapleMonster)mons).applyMonsterBuff(stats, getSkillId(), getDuration(), this, reflection);
         }
       } else {
/*  787 */         monster.applyMonsterBuff(stats, getSkillId(), getDuration(), this, reflection);
       }
     }
/*  790 */     if (disease != null && player != null) {
/*  791 */       if (this.lt != null && this.rb != null && skill && monster != null) {
/*  792 */         for (MapleCharacter chr : getPlayersInRange(monster, player)) {
/*  793 */           chr.giveDebuff(disease, this);
         }
       } else {
/*  796 */         player.giveDebuff(disease, this);
       }
     }
/*  799 */     if (monster != null) {
/*  800 */       monster.setMp(monster.getMp() - getMpCon());
     }
   }

   public int getSkillId() {
/*  805 */     return this.skillId;
   }

   public int getSkillLevel() {
/*  809 */     return this.skillLevel;
   }

   public int getMpCon() {
/*  813 */     return this.mpCon;
   }

   public void setMpCon(int mpCon) {
/*  817 */     this.mpCon = mpCon;
   }

   public List<Integer> getSummons() {
/*  821 */     return Collections.unmodifiableList(this.toSummon);
   }




   public static boolean toSpawnSkill(int skillLevel) {
/*  828 */     switch (skillLevel) {
       case 196:
       case 197:
       case 198:
       case 199:
       case 200:
       case 201:
       case 202:
       case 203:
       case 204:
       case 205:
       case 206:
       case 207:
       case 208:
       case 209:
/*  843 */         return true;
     }
/*  845 */     return false;
   }







   public int getSpawnEffect() {
/*  855 */     return this.spawnEffect;
   }






   public void setSpawnEffect(int spawnEffect) {
/*  864 */     this.spawnEffect = spawnEffect;
   }

   public int getHP() {
/*  868 */     return this.hp;
   }

   public int getX() {
/*  872 */     return this.x;
   }

   public void setX(int x) {
/*  876 */     this.x = x;
   }

   public int getY() {
/*  880 */     return this.y;
   }

   public void setY(int y) {
/*  884 */     this.y = y;
   }

   public long getDuration() {
/*  888 */     return this.duration;
   }

   public void setDuration(long duration) {
/*  892 */     this.duration = duration;
   }

   public long getCoolTime() {
/*  896 */     return this.cooltime;
   }

   public void setCoolTime(long cooltime) {
/*  900 */     this.cooltime = cooltime;
   }

   public Point getLt() {
/*  904 */     return this.lt;
   }

   public Point getRb() {
/*  908 */     return this.rb;
   }

   public int getLimit() {
/*  912 */     return this.limit;
   }

   public void setLimit(short limit) {
/*  916 */     this.limit = limit;
   }

   public boolean makeChanceResult() {
/*  920 */     return (this.prop >= 1.0D || Math.random() < this.prop);
   }

   public int getAreaSequenceDelay() {
/*  924 */     return this.areaSequenceDelay;
   }

   public void setAreaSequenceDelay(int areaSequenceDelay) {
/*  928 */     this.areaSequenceDelay = areaSequenceDelay;
   }

   public int getSkillAfter() {
/*  932 */     return this.skillAfter;
   }

   public void setSkillAfter(int skillAfter) {
/*  936 */     this.skillAfter = skillAfter;
   }

   public int getForce() {
/*  940 */     return this.force;
   }

   public void setForce(int force) {
/*  944 */     this.force = force;
   }

   public int getForcex() {
/*  948 */     return this.forcex;
   }

   public void setForcex(int forcex) {
/*  952 */     this.forcex = forcex;
   }
   public Rectangle calculateBoundingBox(Point posFrom, boolean facingLeft) {
     Point mylt;
     Point myrb;
/*  957 */     if (facingLeft) {
/*  958 */       mylt = new Point(this.lt.x + posFrom.x, this.lt.y + posFrom.y);
/*  959 */       myrb = new Point(this.rb.x + posFrom.x, this.rb.y + posFrom.y);
     } else {
/*  961 */       myrb = new Point(this.lt.x * -1 + posFrom.x, this.rb.y + posFrom.y);
/*  962 */       mylt = new Point(this.rb.x * -1 + posFrom.x, this.lt.y + posFrom.y);
     }
/*  964 */     return new Rectangle(mylt.x, mylt.y, myrb.x - mylt.x, myrb.y - mylt.y);
   }

   private List<MapleCharacter> getPlayersInRange(MapleMonster monster, MapleCharacter player) {
/*  968 */     Rectangle bounds = calculateBoundingBox(monster.getTruePosition(), monster.isFacingLeft());
/*  969 */     List<MapleCharacter> players = new ArrayList<>();
/*  970 */     players.add(player);
/*  971 */     return monster.getMap().getPlayersInRectAndInList(bounds, players);
   }

   private List<MapleMapObject> getObjectsInRange(MapleMonster monster, MapleMapObjectType objectType) {
/*  975 */     Rectangle bounds = calculateBoundingBox(monster.getTruePosition(), monster.isFacingLeft());
/*  976 */     List<MapleMapObjectType> objectTypes = new ArrayList<>();
/*  977 */     objectTypes.add(objectType);
/*  978 */     return monster.getMap().getMapObjectsInRect(bounds, objectTypes);
   }
   public void setMobSkillDelay(MapleCharacter chr, MapleMonster monster, int s, short option) {
     int i;
/*  982 */     List<Rectangle> skillRectInfo = new ArrayList<>();
/*  983 */     switch (this.skillId) {
       case 226:
/*  985 */         option = 0;
/*  986 */         monster.isFacingLeft();
/*  987 */         for (i = 0; i < 3; i++) {
/*  988 */           int av = Randomizer.rand(170, 250);
/*  989 */           skillRectInfo.add(calculateBoundingBox(new Point((monster.getTruePosition()).x + (monster.isFacingLeft() ? -av : av) * (2 * i - 1), (monster.getTruePosition()).y), monster.isFacingLeft()));
         }
         break;
     }




/*  997 */     chr.getMap().broadcastMessage(MobPacket.MobSkillDelay(monster.getObjectId(), this.skillId, this.skillLevel, this.skillAfter, option, skillRectInfo));
   }

   public void SkillMessage(MapleMonster monster) {
/* 1001 */     switch (this.skillId) {
       case 238:
/* 1003 */         switch (this.skillLevel) {
           case 7:
/* 1005 */             monster.getMap().broadcastMessage(UIPacket.getMapEffectMsg("路西德召唤出了强大的召唤兽！", 222, 3));
             break;
         }
         break;
     }
   }
 }


/* Location:              C:\PGX\Server.jar!\server\life\MobSkill.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */